

#ifndef MAIN_H
#define MAIN_H


#include <X11/Xlib.h>
#include <X11/Xutil.h>

#include "Circle.h"
#include "Line.h"
#include "Polygon.h"
#include "Polyline.h"
#include "Triangle.h"
#include "Color.h"

#endif
#include<stdlib.h>

int main(){

  MyDisplay show;

  Color carColor(show,0,0,0); 
  Line xAxis(show),yAxis(show),between2Tyres(show) ;  
  Polyline carBody("carBody.txt",show);
   //show.createWindow( show->getWidth(), show->getHeight(), 0, 0);
   //show.createGC(0);

      xAxis.drawLine(0,-512,0,512); 

      yAxis.drawLine(-512,0,512,0); 

      
      
  Circle tyre(12,show);
   
  //simple car drawing 
  
  
  for(int i =0 ;i<1000;i = i +10){
  
  carColor.setForegroundColor(0,0,0); 
     // back tyre
      tyre.draw(i - 512,0);
    // front tyre  
      tyre.draw(i - 400,0);
     
    carColor.setForegroundColor(130,121,255);    
      between2Tyres.drawLine(i-498,7,i-415,7);
      
      carBody.change(10);
     carColor.setForegroundColor(130,121,255); 
      carBody.draw();
      
  //    sleep(1);
      //XClearArea(show.display,show.win,);
      
      XClearWindow(show.display,show.win);
      
  }    
      
  
  // Triangle t1(show);
   
   //Polygon p1(show);
   //Polyline pl1(show);
  
     //t1.draw(100,100,-100,100);
     //cout<<"End of triangle drawing"<<endl;
    
     //sleep(10);    
     //p1.draw("Polygon.txt");
     //cout<<"End of polygon drawing"<<endl;
     
     //sleep(10);
     //pl1.draw("Polyline.txt");
     //cout<<"End of polyline drawing"<<endl;
     
    sleep(10);
  
  return 1;    

}


